package com.ruoyi.system.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.TbBusinessTel;
import com.ruoyi.system.mapper.TbBusinessTelMapper;
import com.ruoyi.system.service.ITbBusinessTelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商家联系电话Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-07
 */
@Service
public class TbBusinessTelServiceImpl implements ITbBusinessTelService 
{
    @Autowired
    private TbBusinessTelMapper tbBusinessTelMapper;

    /**
     * 查询商家联系电话
     * 
     * @param id 商家联系电话主键
     * @return 商家联系电话
     */
    @Override
    public TbBusinessTel selectTbBusinessTelById(Long id)
    {
        return tbBusinessTelMapper.selectTbBusinessTelById(id);
    }

    /**
     * 查询商家联系电话列表
     * 
     * @param tbBusinessTel 商家联系电话
     * @return 商家联系电话
     */
    @Override
    public List<TbBusinessTel> selectTbBusinessTelList(TbBusinessTel tbBusinessTel)
    {
        return tbBusinessTelMapper.selectTbBusinessTelList(tbBusinessTel);
    }

    /**
     * 新增商家联系电话
     * 
     * @param tbBusinessTel 商家联系电话
     * @return 结果
     */
    @Override
    public int insertTbBusinessTel(TbBusinessTel tbBusinessTel)
    {
        tbBusinessTel.setCreateTime(DateUtils.getNowDate());
        return tbBusinessTelMapper.insertTbBusinessTel(tbBusinessTel);
    }

    /**
     * 修改商家联系电话
     * 
     * @param tbBusinessTel 商家联系电话
     * @return 结果
     */
    @Override
    public int updateTbBusinessTel(TbBusinessTel tbBusinessTel)
    {
        tbBusinessTel.setUpdateTime(DateUtils.getNowDate());
        return tbBusinessTelMapper.updateTbBusinessTel(tbBusinessTel);
    }

    /**
     * 批量删除商家联系电话
     * 
     * @param ids 需要删除的商家联系电话主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessTelByIds(Long[] ids)
    {
        return tbBusinessTelMapper.deleteTbBusinessTelByIds(ids);
    }

    /**
     * 删除商家联系电话信息
     * 
     * @param id 商家联系电话主键
     * @return 结果
     */
    @Override
    public int deleteTbBusinessTelById(Long id)
    {
        return tbBusinessTelMapper.deleteTbBusinessTelById(id);
    }
}
